package com.syqc.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.syqc.entity.ChooseTime
import com.syqc.monitor.R

class ChooseTimeAdapter :
    BaseQuickAdapter<ChooseTime, BaseViewHolder>(R.layout.item_fast_time) {
    var index: Int = -1
    override fun convert(holder: BaseViewHolder, item: ChooseTime) {
        item?.let {
            val view = holder.getView<TextView>(R.id.item_choose_time)
            view.setText(item.timeNameId)
            view.isSelected = index == holder.layoutPosition
        }
    }
}